package xyx.ysfwpt.dao;

import org.apache.ibatis.annotations.Param;
import xyx.ysfwpt.model.User;

import java.util.List;

public interface UserDao {

    User selectUserByName(String username);  //根据用户名查询 （登录）

    List<User> selectAllUser();  //查询所有用户

    User selectUserByJobNumber(int job_number);  //根据工号查询用户（检索用户上级姓名）

    List<User> selectUserByDirector(int director);  //根据direcot查询（检索用户名下的用户表)

    List<User> selectUserByInputList(@Param(value = "department") String department,
                                     @Param(value = "clinical_title") String clinical_title,
                                     @Param(value = "teaching_title") String teaching_title,
                                     @Param(value = "type") String type,
                                     @Param(value = "source") String source,
                                     @Param(value = "state") Integer state,
                                     @Param(value = "searchword") String searchword,
                                     @Param(value = "job_number") Integer job_number,
                                     @Param(value = "user_type") String user_type,
                                     @Param(value = "timefrom") String timefrom,
                                     @Param(value = "timeto") String timeto,
                                     @Param(value = "searchtype") Integer searchtype);  //根据输入框信息查询

    void addUser(User user);  //管理员新增用户

    void updateUser(User user);  //用户信息修改（用户修改个人信息）

    void updateUser2(User user);  //用户信息修改（管理员修改用户信息）

    void updateUserPhoto(@Param(value = "job_number") int job_number, @Param(value = "imgurl") String imgurl);  //用户头像修改

    void updateUserPSW(@Param(value = "job_number") int job_number, @Param(value = "password") String password);  //用户密码修改

    void updateDepartment(@Param(value = "job_number") int job_number, @Param(value = "department") String department, @Param(value = "director") int director);  //用户科室、科室负责人修改

    void updateState(@Param(value = "job_number") int job_number, @Param(value = "state") Integer state);  //用户状态修改

    void updateIslock(@Param(value = "job_number") int job_number, @Param(value = "islock") Integer islock);  //用户状态修改

    void deleteUser(int job_number);  //删除用户

    List<User> selectIsLock2(@Param(value = "islock2") Integer islock2);  //查询被锁定账号

    void updateIsLock2(@Param(value = "job_number") int job_number,
                       @Param(value = "islock2") Integer islock2,
                       @Param(value = "locktime") String locktime);  //解除锁定账号

}
